package com.itheima.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.itheima.dao.BookDao;
import com.itheima.po.Book;
import com.itheima.service.BookService;
@Service("BookService")
@Transactional
public class BookServiceImpl implements BookService {
	@Autowired
	private BookDao bookDao;
	@Override
	public Book getBookInfo(int bookid) {
		// TODO Auto-generated method stub
		return bookDao.getBookInfo(bookid);
	}

	@Override
	public int uploadBook(Book book) {
		// TODO Auto-generated method stub
		return bookDao.uploadBook(book);
	}

	@Override
	public List<Book> searchBook(String keyword) {
		// TODO Auto-generated method stub
		return bookDao.searchBook(keyword);
	}

	@Override
	public int updateStar(int bookid,double star) {
		// TODO Auto-generated method stub
		return bookDao.updateStar(bookid,star);
	}

	@Override
	public List<Book> getBooks(int bookNum, String type) {
		// TODO Auto-generated method stub
		return bookDao.getBooks(bookNum, type);
	}

	@Override
	public List<Integer> getIdList() {
		// TODO Auto-generated method stub
		return bookDao.getIdList();
	}

	@Override
	public int getBookNumOfType(String type) {
		// TODO Auto-generated method stub
		return bookDao.getBookNumOfType(type);
	}

}
